package com.liuyk.commonlib.web.bridge;

/**
 * 通用bridge处理，不能混淆
 */
public class CommonBridge extends BaseBridge {
    private static final String BRIDGE_NAME = "CommonBridge";

    @Override
    public void onCreate() {
        initBridgeMethod(this);
    }

    @Override
    public String getBridgeName() {
        return BRIDGE_NAME;
    }

    @Override
    public Class<?> getClazz() {
        return CommonBridge.class;
    }

    @BridgeMethod(methodName = "nativeCallback")
    public static String nativeCallback(String action, boolean isSync, String extra, String callbackFunction,
                                        String params, BasisView basisView) {
        if (isSync) {
            basisView.onJsCallback(extra, callbackFunction, "nativeCallback");
            return "";
        }
        return "";
    }
}
